# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-symautomata
pkgname=('python2-symautomata' 'python-symautomata')
_pkgname=symautomata
pkgver=0.0.12
pkgrel=9
pkgdesc='A python framework for working with Automata.'
arch=('any')
url='https://pypi.python.org/pypi/symautomata/'
license=('custom:unknown')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('c2b933f7861eec5be24fd82740206e62f37b5e016a7b9214b618fd5a0be2d0e169547e78e63cbd4c2623b43d74aeaac200d95c49baff9e24bc99b52577f1ae1f')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-symautomata() {
  depends=('python2' 'python2-dateutil' 'python2-six')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-symautomata() {
  depends=('python' 'python-dateutil' 'python-six')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

